const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); // 将 css 从 js 文件中抽离出来


module.exports = {
    entry:'./src/index.js',
    output: {
        path:path.join(__dirname,'./dist'),
        filename:'build.js'
    },
    module:{
        rules:[{
            test:/\.css$/,
            use:[MiniCssExtractPlugin.loader,"css-loader","postcss-loader"]
        }]
    },
    plugins:[
        new MiniCssExtractPlugin({
            filename:"[name].css",
            chunkFilename:"[id].css"
        })
        
    ]
}